<template>
  <view>
    <!-- 状态 -->
    <view class="statc">
      <view
        class="cu-load bg-blue loading"
        v-show="pageStatic==0?false:true"
      ></view>
      <view
        class="cu-load bg-red erro"
        v-show="pageStatic==2?false:true"
      ></view>
    </view>
    <!-- 顶部标题\分类 -->
    <view class="top" v-show="pageStatic==1?false:true">
      <view class="topTitle">学分各类别详情</view>
      <view class="varied">
        <view>课程类别</view>
        <view>计划学分</view>
        <view>获得学分</view>
      </view>
    </view>
    <!-- 数据 
    <view class="cont" v-show="pageStatic==1?false:true">
      <view
        wx:for="{{credit}}"
        wx:key="tnane"
        class="animation-slide-bottom item {{index%2==0?'bg-white':'bg-grey'}} light"
        style="animation-delay: {{(index+1)*0.1}}s;"
      >
        <view>{{ item.tname }}</view>
        <view>{{ item.hdxf == null ? "暂无数据" : item.hdxf }}</view>
        <view>{{ item.jhxf == null ? "暂无数据" : item.jhxf }}</view>
      </view>
    </view>-->
  </view>
</template>

<script>
export default {
  data() {
    return {
      pageStatic: 0,
      credit: [],
      token: "",
    };
  },
  onShow() {
      try {
			let stuScoreDto = JSON.parse(options.stuScoreDto);
			console.log(stuScoreDto);
			this.getData(stuScoreDto);
		} catch (e) {
			console.log("<教务中转页面>数据获取错误")
		}
      this.getData()
    let token = uni.getStorageSync("token");
    this.token = token;
  },
  methods: {
    getData(stid) {
      var data = {
        stid: stid,
      };
      guet.stuXfUsingPOST(data, this.data.token).then(
        (res) => {
            console.log(res);
          if (res.data.code == 200) {
            this.credit = res.data.data;
            this.pageStatic = 1;
          } else {
            this.pageStatic = 2;
          }
        },
        (err) => {
          this.pageStatic = 2;
        }
      );
    },
  },
};
</script>

<style lang="scss" scoped>
</style>